import { http } from "@/utils";
import type { CourseCommentsType, CourseDetailResponseType, resCourseDataType } from "./type";
// 1、请求课程页面数据  /api/edu/course/{page}/{limit}
export const reqGetCourseList = (page:number,limit:number) => {
    return http.get<resCourseDataType>(`/api/edu/course/${page}/${limit}`)
}

// 2、获取课程详情  /api/edu/course/{id}
export const reqGetCourseDetail = (id:string) => {
    return http.get<CourseDetailResponseType>(`/api/edu/course/${id}`)
}

// 3、收藏课程  /api/edu/courseCollect/auth/save/{courseId}
export const reqCollectCourse = (courseId:string) => {
    return http.post(`/api/edu/courseCollect/auth/save/${courseId}`)
}

// 4、取消收藏课程  /api/edu/courseCollect/auth/remove/{id}
export const reqRemoveCourse = (id:string) => {
    return http.delete(`/api/edu/courseCollect/auth/remove/${id}`)
}